﻿using SqlSugar;
using StudyCompanion.Core.Models;

namespace StudyCompanion.Entity.Order;

/// <summary>
///     订单
/// </summary>
[SugarTable("ord_order")]
public class Order : BaseEntity
{
    /// <summary>
    ///     订单编号
    /// </summary>
    public string Code { get; set; }

    /// <summary>
    ///     用户Id
    /// </summary>
    public long UserId { get; set; }

    /// <summary>
    ///     创建时间
    /// </summary>
    [SugarColumn(IsOnlyIgnoreInsert = true)]
    public DateTime CreateTime { get; set; }

    /// <summary>
    ///     订单状态
    /// </summary>
    public int Status { get; set; }

    /// <summary>
    ///     交易状态
    /// </summary>
    public int TradeState { get; set; }

    /// <summary>
    ///     订单金额
    /// </summary>
    public decimal OrderAmount { get; set; }

    /// <summary>
    ///     优惠金额
    /// </summary>
    public decimal DiscountAmount { get; set; }

    /// <summary>
    ///     支付金额
    /// </summary>
    public decimal PaidAmount { get; set; }

    /// <summary>
    ///     返利
    /// </summary>
    public decimal Rebate { get; set; }

    /// <summary>
    ///     支付类型
    /// </summary>
    public int? PayType { get; set; }
    
    /// <summary>
    ///     收款二维码短链接
    /// </summary>
    public string CodeUrl { get; set; }

    /// <summary>
    ///     支付编号
    /// </summary>
    public string? PayNumber { get; set; }

    /// <summary>
    ///     支付时间
    /// </summary>
    public DateTime? PayTime { get; set; }

    /// <summary>
    ///     购买月份
    /// </summary>
    public int Months { get; set; }
}